/*
 * @Author: Bo Cai
 * @Mail: caibo0520@qq.com
 * @Date: 2021-10-07 17:27:03
 * @LastEditors: Bo Cai
 * @LastEditTime: 2021-12-03 23:27:21
 */
import request from '@/utils/request'

const api_name = '/edu-service/course'

export default {
    saveCourseInfo(courseInfo) {
        return request({
            url: `${api_name}/save-course-info`,
            method: 'post',
            data: courseInfo
        })
    },
    getCourseInfoById(id) {
        return request({
            url: `${api_name}/get-course-info-by-id/${id}`,
            method: 'get'
        })
    },
    updateCourseInfoById(courseInfo) {
        return request({
            url: `${api_name}/update-course-info/${courseInfo.id}`,
            method: 'put',
            data: courseInfo
        })
    },
    getCoursePublishInfoById(id) {
        return request({
            url: `${api_name}/course-publish-info/${id}`,
            method: 'get'
        })
    },
    publishCourse(id) {
        return request({
            url: `${api_name}/publish-course/${id}`,
            method: 'put'
        })
    },
    getPageList(page, limit, searchObj) {
        return request({
            url: `${api_name}/${page}/${limit}`,
            method: 'get',
            params: searchObj
        })
    },
    removeById(id) {
        return request({
            url: `${api_name}/${id}`,
            method: 'delete',
        })
    },
}